
#ifndef tlmRmtCfgPara_H
#define tlmRmtCfgPara_H

#include "tlmService.h"
#include "tlmRmtCfg.h"
class msgbuf;
//## operation GetEleParaList()
class tlmRmtCfgElementPara;


//## class tlmRmtCfgPara
// This is the base class for service parameters
class tlmRmtCfgPara {
public :

    //#[ type de_tlmRmtCfgElementValueSize
        
    #define TLM_RMT_CFG_PARA_ITEM_STATUS_VALUE_SIZE 1
    #define TLM_RMT_CFG_PARA_ITEM_PERIOD_VALUE_SIZE 2
    #define TLM_RMT_CFG_PARA_ITEM_VIN_VALUE_SIZE MAX_SERVICE_VIN_LENGTH
    #define TLM_RMT_CFG_PARA_ITEM_URL_VALUE_SIZE MAX_ADMIN_URL_STRING_LENGTH
    //#]
    
    

    ////    Constructors and destructors    ////
    

	//## operation tlmRmtCfgPara(uint32_t)
    tlmRmtCfgPara(uint32_t eleCount);
    
    tlmRmtCfgPara();
    ~tlmRmtCfgPara();
    
    ////    Operations    ////
    
    void ClearRequested();
    // Different service fill different parameters
    //## operation Fill()
    void Fill();
    // Get the parameter items.
    // As the item is different in different service, the derived class shall implement the function
    //## operation GetItem(uint8_t)
    virtual tlmRmtCfgElementPara* GetItem(uint8_t code) = 0;
    
    //## operation IsRequested() const
    BOOL IsRequested() const;
    
    //## operation Save()
    virtual uint8_t Save();
    
    //## operation SetMsgBuf(msgbuf)
    void SetMsgBuf(msgbuf* pMsgBuf);
    
    //## operation SetRequested()
    void SetRequested();
    //## operation SetRequested(BOOL)
    void SetRequested(BOOL flag);
    //## operation Update(tlmRmtCfgPara) const
    void Update(tlmRmtCfgPara* pPara) const;

	//## operation GetEleParaList() const
    tlmRmtCfgElementPara** GetEleParaList() const;

    //## operation GetEleParaCount() const;
    uint32_t GetEleParaCount() const;


    uint8_t SaveParameters(uint32_t id, uint8_t* buf, uint32_t size);

    ////    Additional operations    ////
    

    ////    Attributes    ////

protected :
	uint32_t mEleParaCount;		//## attribute mEleParaCount
    
    tlmRmtCfgElementPara** mEleParaList;		//## attribute mEleParaList

    // this attributes only be used in request message
    BOOL mIsRequested;		//## attribute mIsRequested
    msgbuf* mMsgBuf;		//## attribute mMsgBuf
	uint8_t mSrvId;

};

#endif
